/**
 * 
 */
package org.cuatrovientos.listofbrought;

import java.util.Scanner;

/**
 * @author David
 *
 */
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		List myList = new List();
		int option=0;
		String line="";
		String name="";
		int quantity=0;
		float cost=0f;
		Scanner reader = new Scanner(System.in);
		do{
			
			System.out.println("Menu");
			System.out.println("1-Insert product");
			System.out.println("2-Remove product");
			System.out.println("3-Show all");
			System.out.println("4-Exit");
			line=reader.nextLine();
			option=Integer.parseInt(line);
			
			switch(option){
				
				case 1:
					System.out.println("Introduce name:");
					line=reader.nextLine();
					name=line;
					System.out.println("Introduce quantity:");
					line=reader.nextLine();
					quantity=Integer.parseInt(line);
					System.out.println("Introduce cost:");
					line=reader.nextLine();
					cost=Float.parseFloat(line);
					System.out.println(myList.insertProducts(name, quantity, cost));
					break;
				
				case 2:
					System.out.println("Introduce name:");
					line=reader.nextLine();
					name=line;
					System.out.println(myList.removeProducts(name));
					break;
				
				case 3:
					myList.showAllProduct();
					break;
					
				case 4:
			
			}
					
		}while(option!=4);
		reader.close();
		
	}

}
